package caching;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author by panstark
 * @description
 * @notice
 * @date 2020/11/19
 */
@Service
@CacheConfig(cacheNames = "book")
public class BookService {

    @Cacheable(key = "#isbn+#title")
    public Book getBookbyId(String isbn,String title){
        return new Book(isbn,title);
    }
}
